/**
 * @param {number[]} nums
 * @return {number[]}
 */

var sortedSquares = function (nums) {
    let arr = nums.map(item => Math.pow(item, 2))
    return arr.sort((a, b) => a - b)
};